package com.goods.business.converter;
import com.goods.common.model.business.Supplier;
import com.goods.common.vo.business.SupplierVO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;

@Component
public class SupplierListConverter {
    public List<SupplierVO> supplierVOList(List<Supplier> SupplierList){
        List<SupplierVO> SupplierVOS = new ArrayList<>();
        if (!CollectionUtils.isEmpty(SupplierList)){
            for (Supplier Supplier : SupplierList) {
                SupplierVO SupplierVO=convertSupplierVO(Supplier);
                SupplierVOS.add(SupplierVO);
            }
        }

        return SupplierVOS;

    }

    public SupplierVO convertSupplierVO(Supplier Supplier) {
        SupplierVO SupplierVO = new SupplierVO();
        BeanUtils.copyProperties(Supplier,SupplierVO);
        return SupplierVO;
    }
    
}
